﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using l1cs.server.model.Instance;
using l1cs.server.model;
using l1cs.server.datatables;

namespace l1cs.server.clientpackets
{
    public class C_BoardDelete : ClientBasePacket
    {
        private const String _C_BOARD_DELETE = "[C] C_BoardDelete";
        private static Logger _log = Logger.getLogger( typeof( C_BoardDelete ).FullName );

        public C_BoardDelete( byte[] decrypt, ClientThread client )
            : base( decrypt )
        {
            int objId = readD();
            int topicId = readD();
            L1Object obj = L1World.getInstance().findObject( objId );
            L1BoardInstance board = (L1BoardInstance)obj;
            if ( board != null )
            {
                BoardTable.getInstance().deleteTopic( topicId );
            }
        }

        override
        public String getType()
        {
            return _C_BOARD_DELETE;
        }
    }
}